<html>
<head>
<script>
function reloadImg(id) {
   var obj = document.getElementById(id);
   var src = obj.src;
   var pos = src.indexOf('?');
   if (pos < 0) {
      src += "?";
   }else{
      var paramStr = src.substring(pos+1);
      paramStr = paramStr.replace(/&?_r_img=\d*/g, '');
      src = src.substring(0,pos)+"?"+paramStr;
   }
   var date = new Date();
   src +='&_r_img=' + date.getTime();
   obj.src = src;
   return false;
}
</script>
</head>
<body>
  <div><a href="#" onclick="return reloadImg('img');"><img id="img" src="https://passport.baidu.com/?verifypic" /> refresh</a></div>
</body>
</html>